<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>融易拍</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />

    <link rel="stylesheet" href="/static/wx/lib/sui/sm.min.css" />
    <link rel="stylesheet" href="/static/wx/lib/sui/sm-extend.min.css" />

    <link rel="stylesheet" href="/static/wx/css/reset.css" />
    <link rel="stylesheet" href="/static/wx/css/main.css" />
    <link rel="stylesheet" href="/static/wx/css/public_main.css" />
  </head>

  <body>
    <div class="page-group">
      <div class="page page-current" id="info-check">
        <!-- 主内容 -->
        <div class="content">
          <div class="info-check-tip margin-t">
            <span class="line"></span> <span>您单位提供的信息</span>
            <span class="line"></span>
          </div>
          <div class="info-box">
              {if !empty($Think.get.company_name)}
              <div class="info-item">
                  <span>{if ($Think.get.role_id ==3)}物权单位：{else /}单位名称：{/if}</span>
                  <span>{$Think.get.company_name}</span>
              </div>
              {/if}
              {if !empty($Think.get.username)}
              <div class="info-item">
                  <span>姓名：</span>
                  <span>{$Think.get.username}</span>
              </div>
              {/if}
              {if !empty($Think.get.mobile) && $Think.get.role_id !=3}
              <div class="info-item">
                  <span>手机号：</span>
                  <span>{$Think.get.mobile}</span>
              </div>
              {/if}
              <!--{if !empty($Think.get.card_num)}-->
              <div class="info-item">
                  <span>{if ($Think.get.role_id ==3)}报案号：{else /}身份证：{/if}</span>
                  <span>{$Think.get.card_num}</span>
              </div>
              <!--{/if}-->

              <!--{if $Think.get.role_id ==3}-->
              <!--{if !empty($Think.get.c_company_name)}-->
              <div class="info-item">
                  <span>承保单位:</span>
                  <!--<span>{$Think.get.c_company_name}</span>-->
                  <span>111</span>
              </div>
              <!--{/if}-->
              <!--{if !empty($Think.get.c_name)}-->
              <div class="info-item">
                  <span>联系人:</span>
                  <!--<span>{$Think.get.c_name}</span>-->
                  <span>222</span>
              </div>
              <!--{/if}-->
              <!--{if !empty($Think.get.c_mobile)}-->
              <div class="info-item">
                  <span>手机号:</span>
                  <!--<span>{$Think.get.c_mobile}</span>-->
                  <span>333</span>
              </div>
              <!--{/if}-->
              <!--{/if}-->

          </div>
          <div class="info-check-tip">
            <span class="line"></span> <span>填写核对保险公司人员信息</span>
            <span class="line"></span>
          </div>
          <div class="info-check-form">
                <div class="list-block">
                        <ul>
                            <!-- Text inputs -->
                            <li>
                                <div class="item-content size-m">
                                    <div class="item-inner">
                                        <div class="item-title label" style="width:20%">姓名</div>
                                        <div class="item-input">
                                            <input type="text" placeholder="请输入姓名" style="font-size:.65rem" name="name">
                                        </div>
                                    </div>
                                </div>
                            </li>
                            {in name="Think.get.role_id" value="1,3,4"}
                            <li>
                                <div class="item-content size-m">
                                    <div class="item-inner">
                                        <div class="item-title label" style="width:20%"> {in name="Think.get.role_id" value="1,4"}身份证{else/}报案号{/in}</div>
                                        <div class="item-input">
                                            <input type="password" placeholder='{in name="Think.get.role_id" value="1,4"}请输入完整身份证号{else/}请输入报案号{/in}' style="font-size:.65rem" name="card_num">
                                        </div>
                                    </div>
                                </div>
                            </li>
                            {/in}
                            <!--{if ($Think.get.role_id ==3)}-->
                            <!--<li>-->
                                <!--<div class="item-content size-m">-->
                                    <!--<div class="item-inner">-->
                                        <!--<div class="item-title label" style="width:20%">报案号</div>-->
                                        <!--<div class="item-input">-->
                                            <!--<input type="password" placeholder="请输入报案号" style="font-size:.65rem">-->
                                        <!--</div>-->
                                    <!--</div>-->
                                <!--</div>-->
                            <!--</li>-->
                            <!--{/if}-->
                        </ul>
                    </div>
              <input type="hidden" value="{$Think.get.role_id}" name='role_id'>
              <input type="hidden" value="{$Think.get.uid}" name='uid'>
                    <div class="btn-box" style="padding:0">
                            <div class="my-btn">
                                <span class="active size-m" id="submit">确认</span>
                            </div>
                        </div>
                        <p style="padding:.25rem .75rem;">
                            <span class="size-65">信息如有错误请致电客服：<span class="red size-65">400-800-1234</span></span>
                                
                            </p>
          </div>
          
        </div>
      </div>
    </div>

    <script type="text/javascript" src="/static/wx/lib/sui/zepto.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/wx/lib/sui/sm.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/wx/lib/sui/sm-extend.min.js" charset="utf-8"></script>
  </body>
  <script>
      $(function () {
           var  i=0;
          $(document).on('click', '#submit', function () {
              var name = $("input[ name='name']").val();
              var card_num = $("input[ name='card_num']").val();
              var uid = $("input[ name='uid']").val();
              var roo_id = $("input[ name='role_id']").val();
              var srt='请输入身份证号';

              if(roo_id ==3){
                  var srt='请输入报案号';
              }
              if(name.length ==0){
                  $.alert('请填写姓名')
                  return;
              }
              if(roo_id ==2){
                  card_num ='';
              }

              if(card_num.length==0  && (roo_id==1 || roo_id==3|| roo_id ==4)){
                  $.alert(srt)
                  return;
              }

              $.ajax({
                  type: 'POST',
                  url: "{:url('login/checkInfo')}",
                  data: {
                      'uid': uid,
                      'name': name,
                      'code':card_num
                  },
                  dataType: 'json',
                  success: function (Json) {
                      if (Json.code == 200) {
                          location.href = "{:url('index/index')}";
                          //console.log(Json);
                      } else {
                          ++i;
                          if(i>=3){
                              $.alert('信息3次核对错误');
                          }else{
                              $.alert('信息核对错误');
                          }
                      }
                  }
              });
          });


      });
  </script>
</html>
